<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns="http://www.w3.org/1999/xhtml"
                template="./../home.xhtml"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:f="http://xmlns.jcp.org/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                xmlns:pe="http://primefaces.org/ui/extensions">

    <ui:define name="content">
        <div class="col-lg-12">
            <h3 class="page-header" id="comercio">
                Administracion de 
                <h:outputText value="Empleados" style="color:#00BFFF;" />
                <h:link value="Regresar a Listado" outcome="list.xhtml" styleClass="pull-right" style="font-size: 16px; margin-right: 30px;"  />
            </h3>
        </div>

        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-primary">

                    <div class="panel-heading" style="font-weight: bold;" >Actualizar Empleado</div>
                    <div class="panel-body">
                        <div class="row" id="modificarComercio">
                            <div class="col-lg-8 col-lg-offset-1">
                                <h:form id="frmActualizarEmpleado" styleClass="form-horizontal" >
                                    <f:event type="preRenderView" listener="#{empleadoControlador.initActualizar()}" />
                                    <h:messages id="msg" globalOnly="true" styleClass="list-group" infoClass="list-group-item list-group-item-success"
                                                errorClass="list-group-item list-group-item-danger" />
                                    <div class="form-group has-feedback">
                                        <label for="nombre" class="col-sm-3 control-label" >Nombre :</label>
                                        <div class="col-sm-5">
                                            <p:inputText styleClass="form-control" id="nombre" value="#{empleadoControlador.empleado.nombre}"  />
                                        </div>	
                                    </div>
                                    <div class="form-group has-feedback">
                                        <label for="apPaterno" class="col-sm-3 control-label" >Apellido Paterno :</label>
                                        <div class="col-sm-5">
                                            <p:inputText styleClass="form-control" id="apPaterno" value="#{empleadoControlador.empleado.apellidoPaterno}"  />
                                        </div>
                                    </div>
                                    <div class="form-group has-feedback">
                                        <label for="apMaterno" class="col-sm-3 control-label" >Apellido Materno :</label>
                                        <div class="col-sm-5">
                                            <p:inputText styleClass="form-control" id="apMaterno" value="#{empleadoControlador.empleado.apellidoMaterno}"  />
                                        </div>
                                    </div>
                                    <div class="form-group has-feedback">
                                        <label for="tipo" class="col-sm-3 control-label" >Tipo de Empleado :</label>
                                        <div class="col-sm-5">
                                            <h:selectOneMenu styleClass="form-control" id="tipo" value="#{empleadoControlador.empleado.tipo.id}"   >
                                                <f:selectItem  itemLabel="Seleccionar" itemValue="0" />
                                                <f:selectItems value="#{empleadoControlador.tiposEmpleado}" var="list" itemLabel="#{list.descripcion}" itemValue="#{list.id}" />

                                            </h:selectOneMenu>
                                        </div>
                                    </div>
                                    <div class="form-group has-feedback">

                                        <label for="telefono" class="col-sm-3 control-label" >Telefono :</label>
                                        <div class="col-sm-5">
                                            <p:inputMask mask="9?999999" placeHolder=""  styleClass="form-control" id="telefono" value="#{empleadoControlador.empleado.telefono}"  />
                                        </div>
                                    </div>
                                    <div class="form-group has-feedback">
                                        <label for="celular" class="col-sm-3 control-label" >Celular :</label>
                                        <div class="col-sm-5">
                                            <p:inputMask mask="9?99999999" placeHolder="" styleClass="form-control" id="celular" value="#{empleadoControlador.empleado.celular}"  />
                                        </div>
                                    </div>
                                    <div class="form-group has-feedback">
                                        <label for="Direccion" class="col-sm-3 control-label" >Direccion :</label>
                                        <div class="col-sm-8">
                                            <p:inputText styleClass="form-control" id="Direccion" value="#{empleadoControlador.empleado.direccion}"  />
                                        </div> 
                                    </div>
                                    <div class="form-group has-feedback">
                                        <label for="dni" class="col-sm-3 control-label" >DNI :</label>
                                        <div class="col-sm-5">
                                            <p:inputMask mask="9?9999999" placeHolder="" styleClass="form-control" id="dni" value="#{empleadoControlador.empleado.dni}"  />
                                        </div>
                                    </div>

                                    <p:commandButton value="Actualizar" actionListener="#{empleadoControlador.actualiza()}" update="@form" styleClass="btn btn-primary" onstart="PF('blockUIWidget').block()"
                                                     oncomplete="PF('blockUIWidget').unblock();"/>
                                    <pe:blockUI   widgetVar="blockUIWidget">  
                                        <h:panelGrid columns="2">  
                                            <h:graphicImage library="images" name="cargar.gif"  
                                                            style="margin-right: 5px; vertical-align: middle;"/>  
                                            <h:outputText value="Espere ..." style="white-space: nowrap;"/>  
                                        </h:panelGrid>  
                                    </pe:blockUI>
                                </h:form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </ui:define>

</ui:composition>
